Cocktail Help Reference
TryGetValue Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > WeakRefDictionary<TKey,TValue> Class : TryGetValue Method



key
The key
value
The value

Glossary Item Box

Attempts to get a value from the dictionary.

Syntax

Visual Basic (Declaration) 
Public Function TryGetValue( _
   ByVal key As TKey, _
   ByRef value As TValue _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WeakRefDictionary(Of TKey,TValue)
Dim key As TKey
Dim value As TValue
Dim value As Boolean
 
value = instance.TryGetValue(key, value)
C# 
public bool TryGetValue( 
   TKey key,
   out TValue value
)
C++/CLI 
public:
bool TryGetValue( 
   TKey^ key,
   [Out] TValue^ value
) 

Parameters

key
The key
value
The value

Return Value

Returns true if the value was present; false otherwise.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.